<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">

    <div class="layui-card-body">

        <div class="layui-form-item">
            <label class="layui-form-label">上级</label>
            <div class="layui-input-block">
                <select lay-search name="pid" required lay-filter="pid">
                    <option value="">请选择上级</option>
                    <option value="0" {if isset($vo.pid) and $vo.pid eq 0} selected {/if}>无</option>
                    {foreach $pList as $k => $v}
                    <option value="{$v.id}" {if isset($vo.pid) and $vo.pid eq $v.id} selected {/if}>{$v.name}</option>
                    {/foreach}
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input name="name" required placeholder="请输入名称" value="{$vo.name|default=''}" class="layui-input">
                <p class="help-block"></p>
            </div>
        </div>

    </div>

    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}

    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
</form>
<script>
    form.render()
</script>

